package com.ka.magicexplorer.database;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;

import com.ka.magicexplorer.model.pdf_file;

public class db_pdf extends DatabaseStorage<pdf_file> {

	public db_pdf(Context context) {
		super(context);
		table_name = "db_pdf";
	}

	// 4 getAllObject, getObject
	public pdf_file getDataFromCursor(Cursor cursor) {
		pdf_file object = new pdf_file(	cursor.getString(0),
										cursor.getString(1), 
										Boolean.parseBoolean(cursor.getString(2)));
  
		return object;
	}

	// 4 addObject
	public ContentValues attachData2Values(pdf_file obj) {
		
		ContentValues values = new ContentValues();
		values.put(primary_name, obj.getPath());
		values.put(col_name, obj.getName());
		values.put(col_isHiden, obj.getIsHiden().toString());
		
		return values;
	}

	// 4 getObject
	public String[] getInfoOfTable() {
		 
		return (new String [] { primary_name, col_name, col_isHiden });
	}

	// 4 deleteObject, updateObject
	public String getIDFromObject(pdf_file obj) {
		return obj.getPath();
	}
}